package com.ikas.ai.framework.node.impl;

import com.alibaba.fastjson.JSONObject;
import com.ikas.ai.framework.core.model.NodeInputVariables;
import com.ikas.ai.framework.flow.ScoreFlow;
import com.ikas.ai.framework.node.NodeType;

/**
 * @Description: 业务常量节点
 * @Author: wuyf
 * @Date: 2023/12/4 18:31
 * @Version: 1.0.0
 **/
public class BusinessConstantNode extends AbstractNode<JSONObject> {
    private JSONObject param;

    public BusinessConstantNode(ScoreFlow scoreFlow, JSONObject param, Long nodeId, Long nodeInstanceId, String name) {
        super(scoreFlow, nodeId, nodeInstanceId, name);
        this.param = param;
    }

    @Override
    public synchronized void input(NodeInputVariables nodeInputVariables) {
        throw new UnsupportedOperationException("业务常量节点不支持输入操作");
    }

    @Override
    JSONObject doExecute() {
        return this.param;
    }


    @Override
    public NodeType type() {
        return NodeType.BUSINESS_CONSTANT;
    }
}
